* Figure 3a

clear
use Diversification.dta, clear



egen mpop=mean(pop), by(reporter)
drop if mpop<1000000

gen Lngdp=ln(GDPpcppp)
gen Lngdp2=ln(GDPpcppp)*ln(GDPpcppp)



lowess New_1period  GDPpcppp , generate(yg)
lowess  New_2period  GDPpcppp , generate(yg2)
lowess New_KL GDPpcppp , generate(yg3)


keep   GDPpcppp yg yg2 yg3
sort  GDPpcppp
label var  yg "New - 1period"
label var  yg2 "New - 2periods"
label var  yg3 "New - Klinger Lederman"

keep if yg>0

twoway (line yg  GDPpcppp, lcolor(black) lwidth(thick)) (line yg2  GDPpcppp, lcolor(black)  lwidth(thin)) (line yg3  GDPpcppp, lcolor(black) lpattern(dash) lwidth(thick)), ytitle(Nber of new exported products) xtitle(GDP per capita PPP (constant 2005 international $)) legend(size(small)) plotregion(ifcolor(none))




* Figure 3b

clear
use Diversification.dta, clear




drop if year == 1988
drop if year == 1989
drop if year == 1990
drop if year == 1991
drop if year == 1992
drop if year == 1993
drop if year == 1994
drop if year == 1995
drop if year == 1996
drop if year == 2005


egen mpop=mean(pop), by(reporter)
drop if mpop<1000000
gen Lngdp=ln(GDPpcppp)
gen Lngdp2=ln(GDPpcppp)*ln(GDPpcppp)



lowess New_1period  GDPpcppp , generate(yg)
lowess  New_2period  GDPpcppp , generate(yg2)
lowess New_KL GDPpcppp , generate(yg3)

keep   GDPpcppp yg yg2 yg3
sort  GDPpcppp
label var  yg "New - 1period"
label var  yg2 "New - 2periods"
label var  yg3 "New - Klinger Lederman"

keep if yg>0

twoway (line yg  GDPpcppp, lcolor(black) lwidth(thick)) (line yg2  GDPpcppp, lcolor(black)  lwidth(thin)) (line yg3  GDPpcppp, lcolor(black) lpattern(dash) lwidth(thick)), ytitle(Nber of new exported products) xtitle(GDP per capita PPP (constant 2005 international $)) legend(size(small)) plotregion(ifcolor(none))

